package dev.ece.core.engine;

import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
/**
 * 加载器队列
 * @author 潜行的虚影
 *
 */
public class LoaderQueue {

	private static Queue<LoaderItem<? extends Loader>> QUEUE = new ConcurrentLinkedQueue<LoaderItem<? extends Loader>>();
	
	public static <T extends Loader> void push(T loader) {
		QUEUE.add(new LoaderItem<T>(loader));
	}
	
	protected static void loading() {
		if(!QUEUE.isEmpty()) {
			QUEUE.poll().loading();
		}
	}
	
}
